package com.scfire.content

import java.util.Date

import org.grails.databinding.BindingFormat

class Partnerpc implements Comparable{
	
	//姓名
	String name
	//描述
	String description
	//链接地址
	String url
	//头像
	String img
	
	//个人/企业
	String type
	
	//图片创建时间
	@BindingFormat('yyyy-MM-dd HH:mm:ss')
	Date date
	
	static belongsTo = [channelPartnepc:Channelpartnerpc]

    static constraints = {
		name nullable:true
		description nullable:true
		url nullable:true
		img nullable:true
		type nullable:true
		date nullable:true
		
		channelPartnepc nullable:true
    }
	
	@Override
	public int compareTo(Object o) {
		try{
			date.compareTo(o?.date)
		}catch(Exception e){
			return 1
		}
	}
}
